package com.lianzhihui.romeex.mvp.presenter;

import android.content.Context;

import com.lianzhihui.romeex.bean.PledgeRecordsBean;
import com.lianzhihui.romeex.mvp.model.PledgeRecordModelImp;
import com.lianzhihui.romeex.mvp.model.PledgeRecordInterface;
import com.lianzhihui.romeex.mvp.view.PledgeRecordView;

import java.util.List;

/**
 * Description:
 * Author: RAMON
 * CreateDate: 11/30/20 6:23 PM
 * UpdateUser:
 * UpdateDate:
 * UpdateRemark:
 * Version:
 */
public class PledgeRecordPresenter implements PledgeRecordInterface {

    Context context;
    PledgeRecordView iView;
    PledgeRecordModelImp iModel;

    public PledgeRecordPresenter(Context context, PledgeRecordView iView) {
        this.context = context;
        this.iView = iView;
        iModel = new PledgeRecordModelImp(context, this);
    }

    /**
     * 过滤状态质押记录
     *
     * @param pageNum
     * @param status
     */
    public void getPledgeRecord(int pageNum, String status) {
        iModel.getPledgeRecord(pageNum, status);
    }

    @Override
    public void onPledgeRecordSuccess(List<PledgeRecordsBean.PledgeRecordBean> content) {
        iView.onPledgeRecordSucdess(content);
    }

    @Override
    public void onPledgeRecordFail(String message) {
        iView.onPledgeRecordFail(message);
    }

    @Override
    public void onFailure() {

    }
}
